
package FinalProject;

public abstract class Employee {
    protected String name;
    protected String id;
    protected String department;

    public Employee(String name, String id, String department) {
        this.name = name;
        this.id = id;
        this.department = department;
    }

    // 抽象方法
    public abstract double calculateSalary() throws WorkHourException;
    public abstract String generatePaySlip() throws WorkHourException;
    public abstract String getEmployeeType();

    // Getter方法
    public String getName() { return name; }
    public String getId() { return id; }
    public String getDepartment() { return department; }

    @Override
    public String toString() {
        return String.format("%s{name='%s', id='%s', department='%s'}",
                getEmployeeType(), name, id, department);
    }
}